package cn.janus.provider.dubbo;

import cn.janus.UserService;
import cn.janus.component.CustomClaims;
import cn.janus.controller.UserController;
import cn.janus.util.JwtUtil;
import org.apache.dubbo.config.annotation.DubboService;
import org.springframework.beans.factory.annotation.Autowired;

import java.util.Map;

@DubboService
public class HelloServerImpl implements UserService {
    @Autowired
    private UserController userController;

    @Autowired
    private JwtUtil jwtUtil;

    @Override
    public String Hello() {
        return "hello";
    }

    @Override
    public Map<String, Object> JwtBody(String token) {
        Map<String, Object> claims = jwtUtil.extractAllClaims(token);
        return claims;
    }
}
